3.156 \(\int x^2 (a+b \log (c x^n)) (d+e \log (f x^r)) \, dx\)

Optimal. Leaf size=84 \[ \frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f x^r\right )\right )-\frac {1}{27} e r x^3 \left (3 a+3 b \log \left (c x^n\right )-b n\right )-\frac {1}{9} b n x^3 \left (d+e \log \left (f x^r\right )\right )+\frac {1}{27} b e n r x^3 \]

[Out]

1/27*b*e*n*r*x^3-1/27*e*r*x^3*(3*a-b*n+3*b*ln(c*x^n))-1/9*b*n*x^3*(d+e*ln(f*x^r))+1/3*x^3*(a+b*ln(c*x^n))*(d+e
*ln(f*x^r))

________________________________________________________________________________________

Rubi [A]  time = 0.07, antiderivative size = 84, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {2304, 2366, 12} \[ \frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f x^r\right )\right )-\frac {1}{27} e r x^3 \left (3 a+3 b \log \left (c x^n\right )-b n\right )-\frac {1}{9} b n x^3 \left (d+e \log \left (f x^r\right )\right )+\frac {1}{27} b e n r x^3 \]

Antiderivative was successfully verified.

[In]

Int[x^2*(a + b*Log[c*x^n])*(d + e*Log[f*x^r]),x]

[Out]

(b*e*n*r*x^3)/27 - (e*r*x^3*(3*a - b*n + 3*b*Log[c*x^n]))/27 - (b*n*x^3*(d + e*Log[f*x^r]))/9 + (x^3*(a + b*Lo
g[c*x^n])*(d + e*Log[f*x^r]))/3

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 2304

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Log[c*x^
n]))/(d*(m + 1)), x] - Simp[(b*n*(d*x)^(m + 1))/(d*(m + 1)^2), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2366

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.) + Log[(f_.)*(x_)^(r_.)]*(e_.))*((g_.)*(x_))^(m_.), x_Sy
mbol] :> With[{u = IntHide[(g*x)^m*(a + b*Log[c*x^n])^p, x]}, Dist[d + e*Log[f*x^r], u, x] - Dist[e*r, Int[Sim
plifyIntegrand[u/x, x], x], x]] /; FreeQ[{a, b, c, d, e, f, g, m, n, p, r}, x] &&  !(EqQ[p, 1] && EqQ[a, 0] &&
 NeQ[d, 0])

Rubi steps

\begin {align*} \int x^2 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f x^r\right )\right ) \, dx &=-\frac {1}{9} b n x^3 \left (d+e \log \left (f x^r\right )\right )+\frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f x^r\right )\right )-(e r) \int \frac {1}{9} x^2 \left (3 a \left (1-\frac {b n}{3 a}\right )+3 b \log \left (c x^n\right )\right ) \, dx\\ &=-\frac {1}{9} b n x^3 \left (d+e \log \left (f x^r\right )\right )+\frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f x^r\right )\right )-\frac {1}{9} (e r) \int x^2 \left (3 a \left (1-\frac {b n}{3 a}\right )+3 b \log \left (c x^n\right )\right ) \, dx\\ &=\frac {1}{27} b e n r x^3-\frac {1}{27} e r x^3 \left (3 a-b n+3 b \log \left (c x^n\right )\right )-\frac {1}{9} b n x^3 \left (d+e \log \left (f x^r\right )\right )+\frac {1}{3} x^3 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f x^r\right )\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.08, size = 71, normalized size = 0.85 \[ \frac {1}{27} x^3 \left ((9 a e-3 b e n) \log \left (f x^r\right )+9 a d-3 a e r+3 b \log \left (c x^n\right ) \left (3 d+3 e \log \left (f x^r\right )-e r\right )-3 b d n+2 b e n r\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[x^2*(a + b*Log[c*x^n])*(d + e*Log[f*x^r]),x]

[Out]

(x^3*(9*a*d - 3*b*d*n - 3*a*e*r + 2*b*e*n*r + (9*a*e - 3*b*e*n)*Log[f*x^r] + 3*b*Log[c*x^n]*(3*d - e*r + 3*e*L
og[f*x^r])))/27

________________________________________________________________________________________

fricas [A]  time = 0.75, size = 134, normalized size = 1.60 \[ \frac {1}{3} \, b e n r x^{3} \log \relax (x)^{2} - \frac {1}{9} \, {\left (b e r - 3 \, b d\right )} x^{3} \log \relax (c) - \frac {1}{27} \, {\left (3 \, b d n - 9 \, a d - {\left (2 \, b e n - 3 \, a e\right )} r\right )} x^{3} + \frac {1}{9} \, {\left (3 \, b e x^{3} \log \relax (c) - {\left (b e n - 3 \, a e\right )} x^{3}\right )} \log \relax (f) + \frac {1}{9} \, {\left (3 \, b e r x^{3} \log \relax (c) + 3 \, b e n x^{3} \log \relax (f) + {\left (3 \, b d n - {\left (2 \, b e n - 3 \, a e\right )} r\right )} x^{3}\right )} \log \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(a+b*log(c*x^n))*(d+e*log(f*x^r)),x, algorithm="fricas")

[Out]

1/3*b*e*n*r*x^3*log(x)^2 - 1/9*(b*e*r - 3*b*d)*x^3*log(c) - 1/27*(3*b*d*n - 9*a*d - (2*b*e*n - 3*a*e)*r)*x^3 +
 1/9*(3*b*e*x^3*log(c) - (b*e*n - 3*a*e)*x^3)*log(f) + 1/9*(3*b*e*r*x^3*log(c) + 3*b*e*n*x^3*log(f) + (3*b*d*n
 - (2*b*e*n - 3*a*e)*r)*x^3)*log(x)

________________________________________________________________________________________

giac [B]  time = 0.35, size = 161, normalized size = 1.92 \[ \frac {1}{3} \, b n r x^{3} e \log \relax (x)^{2} - \frac {2}{9} \, b n r x^{3} e \log \relax (x) + \frac {1}{3} \, b r x^{3} e \log \relax (c) \log \relax (x) + \frac {1}{3} \, b n x^{3} e \log \relax (f) \log \relax (x) + \frac {2}{27} \, b n r x^{3} e - \frac {1}{9} \, b r x^{3} e \log \relax (c) - \frac {1}{9} \, b n x^{3} e \log \relax (f) + \frac {1}{3} \, b x^{3} e \log \relax (c) \log \relax (f) + \frac {1}{3} \, b d n x^{3} \log \relax (x) + \frac {1}{3} \, a r x^{3} e \log \relax (x) - \frac {1}{9} \, b d n x^{3} - \frac {1}{9} \, a r x^{3} e + \frac {1}{3} \, b d x^{3} \log \relax (c) + \frac {1}{3} \, a x^{3} e \log \relax (f) + \frac {1}{3} \, a d x^{3} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(a+b*log(c*x^n))*(d+e*log(f*x^r)),x, algorithm="giac")

[Out]

1/3*b*n*r*x^3*e*log(x)^2 - 2/9*b*n*r*x^3*e*log(x) + 1/3*b*r*x^3*e*log(c)*log(x) + 1/3*b*n*x^3*e*log(f)*log(x)
+ 2/27*b*n*r*x^3*e - 1/9*b*r*x^3*e*log(c) - 1/9*b*n*x^3*e*log(f) + 1/3*b*x^3*e*log(c)*log(f) + 1/3*b*d*n*x^3*l
og(x) + 1/3*a*r*x^3*e*log(x) - 1/9*b*d*n*x^3 - 1/9*a*r*x^3*e + 1/3*b*d*x^3*log(c) + 1/3*a*x^3*e*log(f) + 1/3*a
*d*x^3

________________________________________________________________________________________

maple [C]  time = 0.53, size = 1640, normalized size = 19.52 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(b*ln(c*x^n)+a)*(d+e*ln(f*x^r)),x)

[Out]

(1/3*b*e*x^3*ln(x^n)+1/6*I*Pi*b*e*x^3*csgn(I*x^n)*csgn(I*c*x^n)^2-1/6*I*Pi*b*e*x^3*csgn(I*x^n)*csgn(I*c*x^n)*c
sgn(I*c)-1/6*I*Pi*b*e*x^3*csgn(I*c*x^n)^3+1/6*I*Pi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Pi^2*b*e*x^3*csgn(I*c*x^n)^3*csgn(I*x^r)*cs
gn(I*f*x^r)^2+1/12*Pi^2*b*e*x^3*csgn(I*c*x^n)^2*csgn(I*f*x^r)^3*csgn(I*c)+1/3*ln(f)*b*e*x^3*ln(x^n)-1/9*b*e*r*
x^3*ln(x^n)+1/3*ln(c)*ln(f)*b*e*x^3-1/9*ln(c)*b*e*r*x^3-1/9*ln(f)*b*e*n*x^3+1/18*I*Pi*b*e*n*x^3*csgn(I*f*x^r)^
3-1/6*I*Pi*b*e*x^3*csgn(I*f*x^r)^3*ln(x^n)+1/18*I*Pi*b*e*n*x^3*csgn(I*f)*csgn(I*x^r)*csgn(I*f*x^r)+1/18*I*Pi*b
*e*r*x^3*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)+1/12*Pi^2*b*e*x^3*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*f)*csgn(I*f*x^
r)^2*csgn(I*c)+1/6*I*Pi*b*d*x^3*csgn(I*x^n)*csgn(I*c*x^n)^2+1/12*Pi^2*b*e*x^3*csgn(I*x^n)*csgn(I*c*x^n)^2*csgn
(I*f*x^r)^3-1/6*I*Pi*ln(f)*b*e*x^3*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)

________________________________________________________________________________________

maxima [A]  time = 0.59, size = 104, normalized size = 1.24 \[ -\frac {1}{9} \, b d n x^{3} - \frac {1}{9} \, a e r x^{3} + \frac {1}{3} \, b d x^{3} \log \left (c x^{n}\right ) + \frac {1}{3} \, a e x^{3} \log \left (f x^{r}\right ) + \frac {1}{3} \, a d x^{3} + \frac {1}{27} \, {\left ({\left (2 \, r - 3 \, \log \relax (f)\right )} x^{3} - 3 \, x^{3} \log \left (x^{r}\right )\right )} b e n - \frac {1}{9} \, {\left (r x^{3} - 3 \, x^{3} \log \left (f x^{r}\right )\right )} b e \log \left (c x^{n}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(a+b*log(c*x^n))*(d+e*log(f*x^r)),x, algorithm="maxima")

[Out]

-1/9*b*d*n*x^3 - 1/9*a*e*r*x^3 + 1/3*b*d*x^3*log(c*x^n) + 1/3*a*e*x^3*log(f*x^r) + 1/3*a*d*x^3 + 1/27*((2*r -
3*log(f))*x^3 - 3*x^3*log(x^r))*b*e*n - 1/9*(r*x^3 - 3*x^3*log(f*x^r))*b*e*log(c*x^n)

________________________________________________________________________________________

mupad [B]  time = 4.04, size = 82, normalized size = 0.98 \[ \ln \left (f\,x^r\right )\,\left (\frac {a\,e\,x^3}{3}-\frac {b\,e\,n\,x^3}{9}+\frac {b\,e\,x^3\,\ln \left (c\,x^n\right )}{3}\right )+x^3\,\left (\frac {a\,d}{3}-\frac {b\,d\,n}{9}-\frac {a\,e\,r}{9}+\frac {2\,b\,e\,n\,r}{27}\right )+\frac {b\,x^3\,\ln \left (c\,x^n\right )\,\left (3\,d-e\,r\right )}{9} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(d + e*log(f*x^r))*(a + b*log(c*x^n)),x)

[Out]

log(f*x^r)*((a*e*x^3)/3 - (b*e*n*x^3)/9 + (b*e*x^3*log(c*x^n))/3) + x^3*((a*d)/3 - (b*d*n)/9 - (a*e*r)/9 + (2*
b*e*n*r)/27) + (b*x^3*log(c*x^n)*(3*d - e*r))/9

________________________________________________________________________________________

sympy [B]  time = 23.75, size = 202, normalized size = 2.40 \[ \frac {a d x^{3}}{3} + \frac {a e r x^{3} \log {\relax (x )}}{3} - \frac {a e r x^{3}}{9} + \frac {a e x^{3} \log {\relax (f )}}{3} + \frac {b d n x^{3} \log {\relax (x )}}{3} - \frac {b d n x^{3}}{9} + \frac {b d x^{3} \log {\relax (c )}}{3} + \frac {b e n r x^{3} \log {\relax (x )}^{2}}{3} - \frac {2 b e n r x^{3} \log {\relax (x )}}{9} + \frac {2 b e n r x^{3}}{27} + \frac {b e n x^{3} \log {\relax (f )} \log {\relax (x )}}{3} - \frac {b e n x^{3} \log {\relax (f )}}{9} + \frac {b e r x^{3} \log {\relax (c )} \log {\relax (x )}}{3} - \frac {b e r x^{3} \log {\relax (c )}}{9} + \frac {b e x^{3} \log {\relax (c )} \log {\relax (f )}}{3} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*(a+b*ln(c*x**n))*(d+e*ln(f*x**r)),x)

[Out]

a*d*x**3/3 + a*e*r*x**3*log(x)/3 - a*e*r*x**3/9 + a*e*x**3*log(f)/3 + b*d*n*x**3*log(x)/3 - b*d*n*x**3/9 + b*d
*x**3*log(c)/3 + b*e*n*r*x**3*log(x)**2/3 - 2*b*e*n*r*x**3*log(x)/9 + 2*b*e*n*r*x**3/27 + b*e*n*x**3*log(f)*lo
g(x)/3 - b*e*n*x**3*log(f)/9 + b*e*r*x**3*log(c)*log(x)/3 - b*e*r*x**3*log(c)/9 + b*e*x**3*log(c)*log(f)/3

________________________________________________________________________________________